<template>
	<view class="hs-panel">
		<view class="hs-panel-head">
			<view class="title"><view>增项列表</view></view>
		</view>
		<view class="hs-panel-body">
			<view class="hs-table">
				<view class="hs-table-row">
					<view class="hs-table-col title"><view class="col-item-text">类型</view></view>
					<view class="hs-table-col"><view>划分</view></view>
					<view class="hs-table-col"><view>数量</view></view>
					<view class="hs-table-col"><view>价格</view></view>
					<view class="hs-table-col"><view>小计</view></view>
				</view>
				<template v-for="(item, index) in addons">
					<view class="hs-table-row" :key="index">
						<view class="hs-table-col title" v-if="item.tag_id > 0">
							<view class="col-item-text">{{ dictionary.getTitleByTag(item.type, item.tag_id, '') }}</view>
						</view>
						<view class="hs-table-col title" v-else>
							<view class="col-item-text">{{ item.other_value ? item.other_value :  item.title }}</view>
						</view>
						<view class="hs-table-col">
							<view>{{ item.cost_master == 2 ? '公司' : item.cost_master == 3 ? '酒店' : '无' }}</view>
						</view>
						<view class="hs-table-col">
							<view>{{ item.amount }}</view>
						</view>
						<view class="hs-table-col">
							<view>{{ item.price }}</view>
						</view>
						<view class="hs-table-col">
							<view>{{ item.total }}</view>
						</view>
					</view>
					<view class="hs-table-row" v-if="item.remark">
						<view class="hs-table-col title">
							<view class="col-item-text">备注</view>
						</view>
						<view class="hs-table-col">
							<view>{{ item.remark }}</view>
						</view>
					</view>
				</template>
			</view>
		</view>
	</view>
</template>

<script>
import dictionary from '@/utils/dictionary.js';
export default {
	props: {
		addons: Array
	},  
	beforeMount() {
		this.dictionary = dictionary;
    }
};

</script>

<style lang="less">
@import url('../common.less');
</style>
